home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / FromTheMag / JW FLV MEDIA PLAYER 4.2 / mediaplayer.exe / player.swf / scripts / com / jeroenwijering / utils / NetClient.as < prev    next >
Text File  |  2008-11-04  |  2KB  |  95 lines

  1. package com.jeroenwijering.utils
  2. {
  3.    public class NetClient
  4.    {
  5.        
  6.       
  7.       private var callback:Object;
  8.       
  9.       public function NetClient(param1:Object)
  10.       {
  11.          super();
  12.          callback = param1;
  13.       }
  14.       
  15.       public function onImageData(param1:Object) : void
  16.       {
  17.          forward(param1,"imagedata");
  18.       }
  19.       
  20.       public function onLastSecond(param1:Object) : void
  21.       {
  22.          forward(param1,"lastsecond");
  23.       }
  24.       
  25.       private function forward(param1:Object, param2:String) : void
  26.       {
  27.          param1["type"] = param2;
  28.          callback.onData(param1);
  29.       }
  30.       
  31.       public function onCaption(param1:String, param2:Number) : void
  32.       {
  33.          forward({
  34.             "captions":param1,
  35.             "speaker":param2
  36.          },"caption");
  37.       }
  38.       
  39.       public function onMetaData(param1:Object) : void
  40.       {
  41.          forward(param1,"metadata");
  42.       }
  43.       
  44.       public function onPlayStatus(param1:Object) : void
  45.       {
  46.          if(param1.code == "NetStream.Play.Complete")
  47.          {
  48.             forward(param1,"complete");
  49.          }
  50.          else
  51.          {
  52.             forward(param1,"playstatus");
  53.          }
  54.       }
  55.       
  56.       public function onBWCheck(... rest) : Number
  57.       {
  58.          return 0;
  59.       }
  60.       
  61.       public function onCaptionInfo(param1:Object) : void
  62.       {
  63.          forward(param1,"captioninfo");
  64.       }
  65.       
  66.       public function onBWDone(... rest) : void
  67.       {
  68.          if(rest.length > 0)
  69.          {
  70.             forward({"bandwidth":rest[0]},"bandwidth");
  71.          }
  72.       }
  73.       
  74.       public function onTextData(param1:Object) : void
  75.       {
  76.          forward(param1,"textdata");
  77.       }
  78.       
  79.       public function RtmpSampleAccess(param1:Object) : void
  80.       {
  81.          forward(param1,"rtmpsampleaccess");
  82.       }
  83.       
  84.       public function onCuePoint(param1:Object) : void
  85.       {
  86.          forward(param1,"cuepoint");
  87.       }
  88.       
  89.       public function onFCSubscribe(param1:Object) : void
  90.       {
  91.          forward(param1,"fcsubscribe");
  92.       }
  93.    }
  94. }
  95.